<!DOCTYPE html>
<html lang="en" xmlns:v-on="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
</head>
<body>

<div id="app">
    <button v-on:click="plusNum">加1</button>
    {{sum | toInt}}
</div>
<script>
    let vm = new Vue({
        el:'#app',
        data:{
            num1:33.123,
            num2:78.09,
            num3:172.45
        },
        filters:{
            toInt(num){
                return parseInt(num)
            }
        },
        computed:{
            sum(){
                return this.num1+ this.num2+ this.num3
            }
        },
        methods:{
            plusNum(){
                return this.num1++
            }
        },
        watch:{
            num1(){
                console.log('我发生了变化，当前值是:'+this.num1)
            }
        }
    })
</script>

</body>
</html>